// Mock数据和接口变量定义

// 城市数据
const cities = [
  { id: 1, name: '广州', pinyin: 'guangzhou' },
  { id: 2, name: '深圳', pinyin: 'shenzhen' },
  { id: 3, name: '东莞', pinyin: 'dongguan' },
  { id: 4, name: '佛山', pinyin: 'foshan' },
  { id: 5, name: '惠州', pinyin: 'huizhou' },
  { id: 6, name: '珠海', pinyin: 'zhuhai' },
  { id: 7, name: '中山', pinyin: 'zhongshan' },
  { id: 8, name: '江门', pinyin: 'jiangmen' }
];

// 热门线路
const hotRoutes = [
  { from: '深圳', to: '广州', price: 28 },
  { from: '深圳', to: '东莞', price: 28 },
  { from: '深圳', to: '惠州', price: 28 },
  { from: '深圳', to: '佛山', price: 28 },
  { from: '深圳', to: '珠海', price: 28 },
  { from: '深圳', to: '中山', price: 28 },
  { from: '深圳', to: '江门', price: 28 }
];

// 班次列表数据
const schedules = [ 
  {
    id: 1,
    departureTime: '08:30',
    arrivalTime: '10:30',
    price: 45,
    availableSeats: 15,
    totalSeats: 30, 
    busType: '舒适',
    company: '深圳市嘟嘟巴士科技有限公司',
    departure: {
      station: '车公庙地铁站B出口',
      address: '深圳市福田区',
      time: '08:30'
    },
    arrival: {
      station: '体育西路地铁站A4出口(手动步梯上)',
      address: '广州市天河区',
      time: '08:45'
    },
    stops: [
      { name: '宝安体育馆', time: '09:00' },
      { name: '体育中心地铁站B出口直走30米', time: '09:30' }
    ]
  },
  {
    id: 2,
    departureTime: '08:55',
    arrivalTime: '11:00',
    price: 59.9,
    availableSeats: 8,
    totalSeats: 30,
    busType: '舒适',
    company: '深圳市嘟嘟巴士科技有限公司',
    departure: {
      station: '车公庙地铁站B出口',
      address: '深圳市福田区',
      time: '08:55'
    },
    arrival: {
      station: '体育西路地铁站A4出口(手动步梯上)',
      address: '广州市天河区',
      time: '09:40'
    },
    stops: [
      { name: '宝安体育馆', time: '09:25' },
      { name: '体育中心地铁站B出口直走30米', time: '09:55' }
    ]
  }
];

// 订单状态
const orderStatus = {
  PENDING: 'pending',
  PAID: 'paid',
  CONFIRMED: 'confirmed',
  BOARDING: 'boarding',
  COMPLETED: 'completed',
  CANCELLED: 'cancelled',
  REFUNDED: 'refunded'
};

// 乘客类型
const passengerTypes = [
  { type: 'adult', name: '成人', price: 1.0 },
  { type: 'discount', name: '优惠', price: 0.8 },
  { type: 'child', name: '儿童', price: 0.5 }
];

// Mock订单数据
const mockOrder = {
  id: '202509051630156',
  date: '08月29日',
  departureTime: '08:30',
  arrivalTime: '11:00',
  from: '深圳',
  to: '广州',
  departure: {
    station: '车公庙地铁站B出口',
    address: '深圳市福田区',
    time: '08:30'
  },
  arrival: {
    station: '韶关高铁站公交站',
    address: '广州市天河区',
    time: '11:00'
  },
  passengers: [
    { name: '张三', phone: '13570787777', id: '44132219900420219' },
    { name: '李四', phone: '13570787777', id: '44132219900420220' }
  ],
  refundRule: '发车前30分钟可退票100%退款，发车前1小时内80%退款，发车前2小时内50%退款，2小时前提供全款退票',
  totalAmount: 90.00,
  status: 'paid',
  ticketNumber: 'B 12345',
  qrCode: 'data:image/png;base64,...',
  createTime: '2023-08-29 08:00'
};

// 个人中心菜单
const profileMenus = [
  { icon: '/pages/images/ticket-icon.png', title: '我的车票', page: 'my-tickets' },
  { icon: '/pages/images/contact-icon.png', title: '乘车联系人', page: 'contacts' },
  { icon: '/pages/images/order-icon.png', title: '我的订单', page: 'my-orders' }
];

// API接口变量
const API_ENDPOINTS = {
  // 城市和线路
  GET_CITIES: '/api/cities',
  GET_HOT_ROUTES: '/api/hot-routes',
  SEARCH_ROUTES: '/api/search-routes',
  
  // 班次查询
  GET_SCHEDULES: '/api/schedules',
  GET_SCHEDULE_DETAIL: '/api/schedule/detail',
  
  // 订单相关
  CREATE_ORDER: '/api/order/create',
  GET_ORDER_DETAIL: '/api/order/detail',
  CANCEL_ORDER: '/api/order/cancel',
  GET_MY_ORDERS: '/api/my-orders',
  
  // 支付
  CREATE_PAYMENT: '/api/payment/create',
  QUERY_PAYMENT: '/api/payment/query',
  
  // 票务
  GET_TICKET: '/api/ticket/detail',
  GET_QR_CODE: '/api/ticket/qrcode',
  
  // 用户相关
  GET_CONTACTS: '/api/user/contacts',
  ADD_CONTACT: '/api/user/contact/add',
  UPDATE_CONTACT: '/api/user/contact/update',
  DELETE_CONTACT: '/api/user/contact/delete'
};

// 导出所有数据
module.exports = {
  cities,
  hotRoutes,
  schedules,
  orderStatus,
  passengerTypes,
  mockOrder,
  profileMenus,
  API_ENDPOINTS
};